import React, { Component } from 'react';
import  {  AppRegistry,Image,Dimensions,View,Navigator} from 'react-native';
import { Container,Button, Content, Item, Input, Icon,Thumbnail, Text ,Left, Right, Body } from 'native-base';
import styles from '../../theme/style';
import Index from './Index';
import {Actions } from 'react-native-router-flux';
export default class Login extends Component {
    // 构造
    constructor(props) {
        super(props);
        // 初始状态
        this.state = {};
        
 
    }
    render() {
        return (
            <Container style={styles.container} >
                <Content >
                    <Body  style={styles.iconStyle}   >
                    <Thumbnail   large  source={{ uri: 'http://facebook.github.io/react-native/img/opengraph.png?2' }}   />
                    </Body>
                    <Item underline>
                        <Input placeholder='QQ号码/手机/邮箱' style={{textAlign:'center'}}/>
                    </Item>
                    <Item underline>
                        <Input secureTextEntry={true} password={true} placeholder='密码' style={{textAlign:'center'}}/>
                    </Item>

                    <Button info style={styles.loginBtnStyle}  onPress={this.LoginClick}>
                        <Text  > 登陆 </Text>
                    </Button>
                    <View style={{flexDirection:'row'}} >
                        <Left>
                            <Button transparent>
                                <Text>无法登录</Text>
                            </Button>
                        </Left>
                        <Right>
                            <Button transparent>
                                <Text>新用户注册</Text>
                            </Button>
                        </Right>
                    </View>
                </Content>

            </Container>


        );
    }
    //登录事件
	LoginClick= event=>{
        // const { navigator } = this.props;
        // //或者写成 const navigator = this.props.navigator;
        // //为什么这里可以取得 props.navigator?请看上文:
        // //<Component {...route.params} navigator={navigator} />
        // //这里传递了navigator作为props
        // if(navigator) {
        //     navigator.replace({
        //         name: 'Index',
        //         component: Index,
        //         params:{
        //             user:'xxd',
        //             pwd:'123'
        //         }
        //     })
        // }
        Actions.mainpage();
    }
}
